/***********************************************************************************************************************************
 * Name:	DB_RecoverySimple.sql
 * Author:	Frank Figearo (frank@sqlnerd.me)
 * Summary:	Change all user DBs to SIMPLE recovery.
 */
SET IMPLICIT_TRANSACTIONS OFF; WHILE 0 < @@TRANCOUNT ROLLBACK;
GO
DECLARE @tsql VARCHAR(MAX) = '';
SELECT @tsql+= 'ALTER DATABASE [' + [name] + '] SET RECOVERY SIMPLE; '
  FROM DBAdmin.DBList('@') l INNER JOIN sys.databases d ON l.database_id = d.database_id
  WHERE [recovery_model] <> 3;
EXEC (@tsql);